<?php

namespace Msign\Controller;

use Think\Controller;
use Msign\Biz as Biz;

class IndexController extends Controller {

    public function index() {
//        $user = new Model\User();
//        $randomUser = $user->getInfoByRandom();
//        $this->assign(array('user' => $randomUser));
        $this->display('Index');
    }

    public function getLockUids() {
        $biz = new Biz\PaymentLock();
        $values = $biz->getLockUid();
        $this->assign('values', $values);
        $this->display('Lock');
    }

    public function getLockContracts() {
        $biz = new Biz\PaymentLock();
        $values = $biz->getLockContract();
        $this->assign('values', $values);
        $this->display('Lock');
    }

    public function getLockHouses() {
        $biz = new Biz\PaymentLock();
        $values = $biz->getLockHouse();
        $this->assign('values', $values);
        $this->display('Lock');
    }

    public function getUidPaymentNums() {
        $biz = new Biz\PaymentLock();
        $values = $biz->getUidPaymentSet();
        $this->assign('values', $values);
        $this->display('Payment');
    }

    public function getContractPaymentNums() {
        $biz = new Biz\PaymentLock();
        $values = $biz->getContractPaymentSet();
        $this->assign('values', $values);
        $this->display('Payment');
    }

    public function unlockUidPayment() {
        $biz = new Biz\PaymentLock();
        $uid = I('get.uid');
        $result = $biz->unlockUid($uid);
        $this->assign('result', $result);
        $this->display('UnlockResult');
    }

    public function unlockContractPayment() {
        $biz = new Biz\PaymentLock();
        $contract_code = I('get.contract_code');
        $result = $biz->unlockContract($contract_code);
        $this->assign('result', $result);
        $this->display('UnlockResult');
    }

    public function unlockPaymentHouse() {
        $biz = new Biz\PaymentLock();
        $house_code = I('get.house_code');
        $result = $biz->unlockHouse($house_code);
        $this->assign('result', $result);
        $this->display('UnlockResult');
    }

}
